package edu.cis084.week1;

public class EggBasket
{

	int amountInBasket;
	int maxAmountInBasket;

	public EggBasket()
	{
		amountInBasket = 0;
		maxAmountInBasket = 6;
	}

	public EggBasket(int initialAmount, int basketSize)
	{
		amountInBasket = initialAmount;
		maxAmountInBasket = basketSize;
	}

	public int getEggCount()
	{
		return amountInBasket;	
	}

	public void addEggs(int amountToAdd)
	{
		if(amountInBasket + amountToAdd > maxAmountInBasket)
		{
			System.out.println("You can't add that many eggs. The basket would overflow!");
		}
		else
		{
			amountInBasket+=amountToAdd;	
		}
	}

	public void removeEggs(int amountToRemove)
	{
		if(amountInBasket - amountToRemove < 0)
		{
			System.out.println("You can't remove that many eggs. The basket doesn't have that many in it!");
		}
		else
		{
			amountInBasket-=amountToRemove;	
		}
		
	}
}
